package msz.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import msz.dao.ItemCategoryMapper;
import msz.domain.Item;
import msz.domain.ItemCategory;
import msz.domain.ItemCategoryVo;
import msz.service.ItemCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ItemCategoryServiceImpl implements ItemCategoryService {
    @Autowired
    ItemCategoryMapper itemCategoryMapper;
    @Override
    public List<ItemCategory> findAll(Integer currentPage) {
        PageHelper.startPage(currentPage,2);
        List<ItemCategory> itemCategoryList = itemCategoryMapper.findAllAdByPage();
        return itemCategoryList;
    }

    @Override
    public void deleteBatch(Integer[] ids) {
        itemCategoryMapper.deleteBatch(ids);
    }

    @Override
    public void add(Item item) {
        itemCategoryMapper.add(item);
    }

    @Override
    public void update(Item item) {
        itemCategoryMapper.update(item);

    }

    @Override
    public Item findItemById(Integer id) {
        return itemCategoryMapper.findItemById(id);
    }
}
